package com.soyotec.algorithm.solution.value;

import com.soyotec.algorithm.value.Limit;
import com.soyotec.algorithm.value.Value;

import java.io.Serializable;

public abstract class SolutionValue<T extends Value> implements Serializable {
    private T value;
    private Limit<T> limit;

    public SolutionValue(Limit<T> limit){
        this.limit=limit;
        initValue();
    }

    public SolutionValue(){
        initValue();
    }

    public SolutionValue(T value){
        this.value=value;
    }

    public SolutionValue(Limit<T> limit,T value){
        this.limit=limit;
        this.value = value;
    }
    
    protected abstract void initValue();

    public Limit<T> getLimit() {
        return limit;
    }

    public void setLimit(Limit<T> limit) {
        this.limit = limit;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public T getValue() {
        return value;
    }
}
